package com.haoze.nurseapp.dao;

import com.haoze.nurseapp.dto.PatientExamDTO;
import com.haoze.nurseapp.model.PatientOrdersEntity;
import com.haoze.nurseapp.vo.*;
import io.lettuce.core.dynamic.annotation.Param;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

public interface PatientMapper {

    List<Map<String, Object>>  queryPatients(@Param("wardId") String wardId,@Param("search") String search);

    String getBloodType(String inpatNum);

    String queryDiagIdByInpatNum(String inpatNum);

    String queryDiagByDiagId(String diagId);

    String queryOutHospitalDiag(String inpatNum);

    String queryOutpatientDiag(String inpatNum);

    String getLatestBedNo(String inpatNum);

    Map<String, String> queryPatientInfo(@Param("inpatNum") String inpatNum);

    List<Map<String, String>> queryConditionInfo(@Param("inpatNum") String inpatNum);//通过病人住院号获取 护理登记 病重 药物过敏 和评分

    List<Map<String, String>> queryHighRisk(@Param("inpatNum") String inpatNum);//高危信息查询

    List<Map<String, String>> queryHighRiskList(@Param("inpatNums") List<String> inpatNums);//高危信息查询列表-优化速度用

    /**
     * 根据传入的二维码编码查询病人医嘱信息以确定编码为病人入院号
     * @param qrCode
     * @return
     */
    Integer queryPatientOrders(String qrCode);

    /**
     * 查询患者-住院中-检查列表
     * @param inpatNum
     * @param times
     * @param type
     * @return
     */
    List<PatientExamListVO> queryExamList(@Param("inpatNum") String inpatNum,@Param("times")String times,@Param("type")String type,@Param("reqNum") String reqNum);

    /**
     * 检查报告详情
     * @param reqNum
     * @return
     */
    PatientExamDetailVO getExamReportDetail(@Param("reqNum") String reqNum,@Param("serialNum") Integer serialNum);

    /**
     * examItem详情
     * @param examItemId
     * @return
     */
    PatientExamDetailVO getExamItemDetail(String examItemId);

    /**
     * 查询患者-住院中-检验列表
     * @param inpatNum
     * @param type
     * @param times
     * @return
     */
    List<PatientLabListVO> queryLabList(@Param("inpatNum")String inpatNum, @Param("type")String type, @Param("times")String times);


    /**
     * 获取检验详情
     * @param labItemId
     * @return
     */
    PatientLabTopDetailVO getLabDetail(String labItemId);


    /**
     * 获取检验报告详情
     * @param
     * @return
     */
    List<PatientLabReportDetailVO> getLabReportDetail(@Param("reqNum")String reqNum,@Param("serialNumber")String serialNumber);

    /**
     * 获取病人信息
     *  taokuan
     * @param inpatNum
     * @return
     */
    Map<String, String> getPatientInfo(@Param("inpatNum") String inpatNum);

    /**
     * 根据deptid获取deptCode信息
     * @param deptId
     * @return
     */
    Map<String, String> getDeptCodeById(@Param("deptId") String deptId);

    /**
     * 获取病人信息
     *  taokuan
     * @param inpatNum
     * @return
     */
    Map<String, String> queryPatientByInpatNum(@Param("inpatNum") String inpatNum);

    Map<String, String> findPatientById(@org.apache.ibatis.annotations.Param("inpatNum") String inpatNum);

    Map<String, String> getPatientOrderUser(@org.apache.ibatis.annotations.Param("orderId") String orderId);

    String queryAllergicDrugs(@org.apache.ibatis.annotations.Param("inpatNum") String inpatNum);

    String queryEatingHabits(@org.apache.ibatis.annotations.Param("inpatNum") String inpatNum);

    List<Map<String,String>> getExamArrangement(@Param("dateTime") String dateTime,@Param("type") String type,@Param("wardDeptId") String wardDeptId,
                                                @Param("checkDeptId") String checkDeptId,@Param("keyWords") String keyWords,@Param("wholeInpatNum") String wholeInpatNum);


    List<Map<String,String>> getCheckDept(@Param("dateTime") String dateTime,@Param("type") String type,@Param("wardDeptId") String wardDeptId,
                                                @Param("checkDeptId") String checkDeptId,@Param("keyWords") String keyWords,@Param("wholeInpatNum") String wholeInpatNum);


    List<PatientExamDTO> getExamArrangementPrint(@Param("dateTime") String dateTime, @Param("type") String type, @Param("wardDeptId") String wardDeptId,
                                                 @Param("checkDeptId") String checkDeptId, @Param("keyWords") String keyWords, @Param("wholeInpatNum") String wholeInpatNum,
                                                 @Param("patexamreportdataIds") String patexamreportdataIds);

    /**
     * 查询血型 ABOAndRH
     * @param inpatNum
     * @return map key:LAB_REPORT_ITEM_CODE REPORT_RESULT
     */
    List<Map<String, String>> queryBloodABOAndRH(@org.apache.ibatis.annotations.Param("inpatNum") String inpatNum);
}
